#!/usr/bin/env python
# -*- coding:utf-8 -*-

'multi-parents example'

__author__='zhaoxp'

class Parent1(object):
	def __init__(self):
		print("Parent1 init")
	def bar(self,msg):
		print(msg,"from Parent1")

class Parent2(object):
	def __init__(self):
		print("Parent2 init")
	def bar(self,msg):
		print(msg,"from Parent2")
		
class Parent3(object):
	def __init__(self):
		print("Parent3 init")
	def bar(self,msg):
		print(msg,"from Parent3")

class Child1(Parent2,Parent1,Parent3):
	def __init__(self):
		Parent1.__init__(self)
		print("Child1 init")
	def bar(self,msg):
		print(dir(self))
		Parent2.bar(self,msg)
		print("Child1 bar func")
		#print(self.parent)
	
class Child2(Parent2,Parent1,Parent3):
	def __init__(self):
		super(Child2,self).__init__()
		print("Child2 init")
	def bar(self,msg):
		super(Child2,self).bar(msg)
		
	
if __name__=='__main__':
	c1=Child1()
	c1.bar("===c1===")
	print("1----------------------")
	c2=Child2()
	c2.bar("---c2---")
	